function
XControl(c){this._type="XControl";this._setting=c||{};this._onInit_funcArr=[];XControl.superclass.constructor.call(this,this._setting);var
e=null;this.dataSource=function(f){if(f==null){return e;}else{e=f;}};var
b=this._setting;if(b.handler){for(var a in
b.handler){this[a]=b.handler[a];}}if(b.on){for(var d in
b.on){$jex.event.binding(this,d,b.on[d]);}}}$jex.extendClass(XControl,UIObject);XControl.prototype.update=$jex.VOIDFUNC;XControl.prototype.updateSource=function(a){if(a){this.dataSource(a);}this.update(this.dataSource());};XControl.prototype.initialize=function(){for(var
a=0;a&lt;this._onInit_funcArr.length;a++){this._onInit_funcArr[a].call(this);}this._onInit_funcArr=[];};XControl.prototype.elem=function(){return
this._setting.elemId?$jex.$(this._setting.elemId):null;};XControl.prototype.onInit=function(a){if(typeof
a=="function"){this._onInit_funcArr.push(a);}};XControl.prototype.render=function(a){var
b=a||this.elem();if(!b){$jex.console.info("[XControl]娌℃湁鍙緵鐢熸垚HTML鐨勫鍣�",this);return;}this.write(b);};XControl.prototype.show=function(){};XControl.prototype.hide=function(){};XControl.prototype.find=XControl.prototype.getDomNode;function
DataCenter(a){this._dataInterface=a.dataInterface;this._fromCity=encodeURIComponent(a.fromCity);this._toCity=encodeURIComponent(a.toCity);this._fromDate=a.fromDate;this._returnDate=a.returnDate;this._flyType=a.flyType;this._randomArr={};this._showMeTheMoney=window.location.href.indexOf("ShowMeTheMoney")&gt;-1?true:false;}DataCenter.method("_createRandom",function(a){var
b=parseInt(Math.random()*a);while(this._randomArr[b]){b=parseInt(Math.random()*a);}this._randomArr[b]={};return
b;});DataCenter.method("getData",function(e){var b=this;if(typeof
e=="undefined"){var
a=[this._dataInterface,"&amp;deptCity=",this._fromCity,"&amp;arriCity=",this._toCity,"&amp;deptDate=",this._fromDate.replace(/-/ig,""),"&amp;arriDate=",this._returnDate.replace(/-/ig,""),"&amp;flyType=",this._flyType,"&amp;ver=",new
Date().getTime()].join("");}else{var
c=[this._dataInterface,"&amp;deptCity=",e.fromCity,"&amp;arriCity=",e.toCity,"&amp;deptDate=",e.fromDate.replace(/-/ig,""),"&amp;arriDate=",this._returnDate.replace(/-/ig,""),"&amp;flyType=",this._flyType,"&amp;ver=",new
Date().getTime()];if(e.fromDate==this._fromDate){if(this.gt){c.push("&amp;gt=",this.gt.replace(":",""));}}var
a=c.join("");}if(this._showMeTheMoney){a=a+"&amp;ShowMeTheMoney";}TTSLOG.setLog("info","寮€濮嬪彇鏁�","url",a);var
d=new
ScriptRequest({oncomplete:function(f){if(!f){b.showInfo("鏈煡璇㈠埌鑸彮锛岃鏇存崲鏉′欢鍐嶈瘯");return;}b.parseData(f);},callbackName:"callback"});d.send(a);});DataCenter.method("parseData",function(b){if(b.busy){window.location="/tts/busy.jsp?ret="+encodeURIComponent(window.location.href.toString());return;}if(!b){this.showInfo("鏈煡璇㈠埌鑸彮锛岃鏇存崲鏉′欢鍐嶈瘯");return;}if(b.error){this.showInfo("鏃犳晥鑸嚎锛岃鏇存崲鏉′欢鍐嶈瘯");return;}if(this._showMeTheMoney){this._cacheData=b;}else{this._cacheData=this._reductionPrice(b);}var
a=this.getKeys();this.sort(a);this._keys=a;this._nowKeys=a;this.creatFilter();this.breakPage(this._keys);this.showPage(1);});eval((function(a){var
e="";var
c=0;while(c&lt;a.length){if(a.charAt(c)!="`"){e+=a.charAt(c++);}else{var
b=a.charCodeAt(c+3)-28;if(b&gt;4){e+=e.substr(e.length-a.charCodeAt(c+1)*96-a.charCodeAt(c+2)+3104-b,b);}else{e+="`";}c+=4;}}return
e;})('DataCenter.method("_confusionPrice",function(keys){var
self=this;var priceInfo` .!.get` U!Info();if(!` 9%){return;}`
F!_tempStyle=[];` -"random=[]` w!_idx=1000;$jex.array.each`!I!`!Q\'){`
|%[k].linecode=self._`
7!Error(k,_idx);_idx++;})`!1#create`!H!(`!N+.join(""));});`#
0redu`!D!`#$,data`"M$(` -%result,type`#K"`#9&amp;` 5".`
(%`"a!new`#J%={}`#p"ower=[1`#""flights`#/$` Z!` )!for(var key in`
&amp;){if(typeof` +&amp;[key]!="`!a$"){` r#.pus`#o!);}}`
,$sort()`!,!size=` 0$length`!2%i=0;i&lt;size;i++`$B#` k#`!1&amp;`
V#[i]]);`"8![i+1]=` $#]*(i+2);}`!T$
Reverse(`%O!,left,right){while(left&lt;` +#var temp=` H![left];`
"&amp;++]` 3#` K!` 3$` (!--]=temp;}}`!|1=10`
z"n=size-i-1;if(n-5&gt;7){n=12;}`(N"ed=(Math.abs`"S"s[i].mxl)-1)%`"C"n]+1;`!{"seed&gt;1`$D!`
X!=2`!~\'`#&amp;%+n];`#3%+n]` .(-1` /)-1`"$#break;}else ` w#&gt;`
v#pos=0`$R%j=0;j&lt;=n;j++`!D!`!_"j]&gt;=seed){pos=j` h$`"C!left=n-pos;`
G%pos]=` K#`$O$`!Q#,i+`$V!i+n)`!L(`!H!r=`#+!floor`!a!/` g%-1])`
U!;seed%`%`#`
3";`#)%0){r--`#{"`#(+r`(2&amp;j=i+r;j&gt;`!E";j--`\'o%[j`#G&amp;j-1];`\'u$[`
G"`#J#`!%(`"+2+1`"="}}}}i++;`%w2+`#"` U"`!c&amp;].split("~")[0` %%/`
)!`);!delta=(parseInt`!6#.substr(0,2)+` %*` \'#`)e"-1),36)+` V%"0"`
A+2,` D*3),10)*36*36*36)%97;`+K#`"a!var arr=`\'^&amp;`
%!Data`&amp;/+arr`+*$`&amp;A!arr[j].pr=`!J!Float(` ,%)-`"F!;` *#n` 21n`
&gt;&amp;}`!7&amp;c` &gt;*` ,)` F%`(,$`"#"1`,F$`!x%` L2` %!` M32` V*`
I4` V$`!AK`%o5`0H(`.1(`$(&amp;;}`0},=` I(;`1p" `
?";})`2(!,0`2L5`3[&amp;`2V\'pr`3j"`%L!`3N!Pr`1^$`3X&amp;`
)%idx=`45!"";pr=pr`\'d$")`0a+p`%m%`(N%_random`#/"Int`.H"` /"()*10`1f"`
@#Sort`!&amp;"this._createR` H"10` ;.1` +?truePr=["&lt;span
class=\\"s",` ^\',"\\"&gt;"].join`"5!` V!fals` :&gt;1` G2s`#@"".`
z,{z-index:",1000-i,";left:",i*1,"em}` W21` \\.1` ].`+h&amp;`#[-+1)`
n&lt;`%I#.push([`#6#,pr[i],"&lt;/span`"?(` @-`#,#`!\\$` &gt;2`$J"`
&lt;"` S"`"(\'` 7$`&amp;a%` ;#`"^!` T$` (11`!D&amp;sort();}`
~(Ar`\'b!`(]#` B$`"Q%`(L3`&amp;0"`!\'!`(Y\'`!+!s`\'^"s=`!!!airCod`
D"`3d!s){s.parentNode.removeChild(s);}s=document.` "Element("` y!"`"E#`
k)=s;s.`,`!"text/css"`!\'!.` O!Sheet){`
"(.cssText=`!m"`4d#s.append`!H"`!9+Tex`!m!`"&gt;$);}`
9%get`!`#sByTagName("head`2b"`
k(s`#P!'));DataCenter.method("showInfo",function(a){$jex.$("flightList").innerHTML=['&lt;div
class="noflight"&gt;',a,"&lt;/div&gt;"].join("");$jex.$("listPage").innerHTML="";$jex.$("filterPanel").innerHTML="";$jex.$("sortPanel").innerHTML="";$jex.$("sortPanel").style.display="none";this.setAtt("noData",true);});DataCenter.method("showLineInfo",function(){});DataCenter.method("getKeys",function(){var
a=[];var
b=this.getPriceInfo();if(!b){TTSLOG.setLog("error","鏈繑鍥炴姤浠蜂俊鎭�");return;}$jex.hash.each(b,function(d,c){a.push(d);});return
a;});DataCenter.method("getNums",function(){return
this.getKeys().length;});DataCenter.method("getNowKeys",function(){return
this._keys;});DataCenter.method("getOderBy",function(){return
this._oderBy;});DataCenter.method("sort",function(b){var a=this;var
c=this.getPriceInfo();$jex.hash.each(c,function(g,f){var
i=f.priceData;if(i.length&gt;0){i.sort(function(k,j){return
k.pr-j.pr;});f.od=i[0].pr;f.lowestPriceData=i[0];var
e=[],h=[];$jex.array.each(i,function(j){if(j.tp=="a"){h.push(j);}else{e.push(j);}});h.sort(function(k,j){return
k.pr-j.pr;});e.sort(function(k,j){return
k.pr-j.pr;});if(h.length&gt;0){f.alp=h[0].pr;}else{f.alp=0;}if(e.length&gt;0){f.nlp=e[0].pr;}else{f.nlp=0;}}else{f.od=1000000;}f.key=g;var
d=a.getExtInfo(g);f.dt=parseFloat(d.deptTime().replace(":",""));});this.sortKeys(b,"od");});DataCenter.method("sortKeys",function(c,b){var
a=this;c.sort(function(e,d){return
a.getOderIndex(e,b)-a.getOderIndex(d,b);});this._keys=c;this._oderBy=b;return
c;});DataCenter.method("getPriceInfo",function(){if(!this._cacheData.priceInfo){return;}return
this._cacheData.priceInfo;});DataCenter.method("getOderIndex",function(b,a){return
this.getPriceInfo()[b][a];});DataCenter.method("getPriceNum",function(){return
this._keys.length;});DataCenter.method("breakPage",function(e){var
g=this.getPriceNum();var c=TTSCONFIG.numOfPage;var
a=Math.ceil(e.length/c);var f=[];for(var d=1;d&lt;=a;d++){var
b=[];$jex.array.each(this._keys,function(i,h){if(h&lt;c*d&amp;&amp;h&gt;=c*(d-1)){b.push(i);}});f.push(b);}this.pageLists=f;});DataCenter.method("getPageData",function(a){return
this.pageLists[a-1];});DataCenter.method("showPages",function(a,d){var
c=new PageUI({elemId:"listPage"});c.owner(this);var
b={pages:a,nowpage:d};c.updateSource(b);c.render();});DataCenter.method("showPage",function(a){this._confusionPrice(this.getPageData(a));this.showList(this.getPageData(a),this._cacheData.priceInfo);this.showPages(this.pageLists.length,a);});DataCenter.method("getExtInfo",function(a){return
new
ExtInfo(this._cacheData.extInfo[a]);});DataCenter.method("priceInfo",function(a){return
new
PriceInfo(this._cacheData.priceInfo[a]);});DataCenter.method("creatFilter",function(){var
a=this;TTSLOG.setLog("info","寮€濮嬪垱寤鸿繃婊�");var
b={airName:{key:"airName",name:"鑸┖鍏徃",data:[]}};$jex.hash.each(this.getPriceInfo(),function(d,c){var
e=[];var f=a.getExtInfo(d);f.rawData(a);var
e=f.airCode();if(e.indexOf(e)&lt;0){e.push(e);}if(b.airName.data.indexOf(e)&lt;0){b.airName.data.push(e);}c.airName=e;});this._cacheData.filters=b;TTSLOG.setLog("info","杩囨护椤瑰垱寤哄畬姣�");});DataCenter.method("getFilters",function(){return
this._cacheData.filters;});DataCenter.method("doFilter",function(b,c){var
a=[];$jex.hash.each(this.getPriceInfo(),function(e,d){$jex.array.each(c,function(f){if(d[b].indexOf(f)&gt;-1){a.push(d.key);}});});return
a;});DataCenter.method("getAirName",function(a){return
this._cacheData.airnameCodeMap[a].full;});DataCenter.method("getAirNameShort",function(a){return
this._cacheData.airnameCodeMap[a].zh;});DataCenter.method("getAirport",function(a){return
this._cacheData.airportCodeMap[a];});DataCenter.method("getDistance",function(){return
this._cacheData.baseInfo.lc;});DataCenter.method("deptCity",function(){return
decodeURIComponent(this._fromCity);});DataCenter.method("arriCity",function(){return
decodeURIComponent(this._toCity);});DataCenter.method("deptDate",function(){return
decodeURIComponent(this._fromDate);});DataCenter.method("deptDateWeek",function(){var
b=QunarDate.parse(decodeURIComponent(this._fromDate)).getDay();var
a=["鏃�","涓€","浜�","涓�","鍥�","浜�","鍏�"];return"鏄熸湡"+a[b];});DataCenter.method("arriDate",function(){return
decodeURIComponent(this._returnDate);});DataCenter.method("isRoundtrip",function(){if(this._flyType=="1"){return
false;}else{return
true;}});DataCenter.method("setAtt",function(b,a){this[b]=a;});DataCenter.method("doSearchReturn",function(){this.getData({fromCity:this._toCity,toCity:this._fromCity,fromDate:this._returnDate});});DataCenter.method("isReturn",function(){if(!this.isRet){return
false;}return
this.isRet;});DataCenter.method("getToData",function(){return
this.gotoData;});function
ExtInfo(a){this.cacheData=a;this.rawData=function(b){if(b==null){return
_rawData;}else{_rawData=b;}};}ExtInfo.method("getAirName",function(){return
this.rawData().getAirName(this.airCode());});ExtInfo.method("deptTime",function(){return
this.parseTime(this.cacheData.dt);});ExtInfo.method("arriTime",function(){return
this.parseTime(this.cacheData.at);});ExtInfo.method("parseTime",function(d){var
b=d.length;var c=d.substr(0,2);var
a=d.substr(2,b-2);return[c,":",a].join("");});ExtInfo.method("shareCode",function(){return
this.cacheData.gx||false;});ExtInfo.method("deptAirportCode",function(){return
this.cacheData.dp;});ExtInfo.method("arriAirportCode",function(){return
this.cacheData.ap;});ExtInfo.method("deptAirport",function(){return
this.rawData().getAirport(this.deptAirportCode());});ExtInfo.method("arriAirport",function(){return
this.rawData().getAirport(this.arriAirportCode());});ExtInfo.method("airCode",function(){return
this.cacheData.ac;});ExtInfo.method("stopInfo",function(){return
this.cacheData.jt;});ExtInfo.method("flightType",function(){return
this.cacheData.ft;});ExtInfo.method("hasFood",function(){return
this.cacheData.fd;});ExtInfo.method("allTime",function(){return
this.cacheData.tl;});function PriceInfo(b){this.cacheData=b;var
a=null;this.rawData=function(c){if(c==null){return
a;}else{a=c;}};}PriceInfo.method("airportPrice",function(){return
this.cacheData.jj;});PriceInfo.method("fuelPrice",function(){return
this.cacheData.ry;});PriceInfo.method("lineCode",function(){return
this.cacheData.linecode;});PriceInfo.method("fuelcPrice",function(){return
this.cacheData.cry;});PriceInfo.method("priceData",function(){return
this.cacheData.priceData;});PriceInfo.method("lowestPriceData",function(){return
this.cacheData.lowestPriceData;});PriceInfo.method("lowestPrice",function(){return
parseFloat(this.cacheData.lowestPriceData.pr);});PriceInfo.method("lowestCw",function(){return
this.cacheData.lowestPriceData.cw;});PriceInfo.method("lowestTgq",function(){var
b=this.cacheData.lowestPriceData.tgq;if(b==null){return false;}var
a=b.split("|");if(a.length&gt;1){return a.join("&lt;br
/&gt;");}else{if(b.length&gt;256*3){b=b.substr(0,256*3)+"...";}return
b+'&lt;div
class="tip"&gt;閫€鏀圭瑙勫畾浠ヨ埅绌哄叕鍙告渶鏂版爣鍑嗕负鍑嗐€�&lt;/div&gt;';}});PriceInfo.method("lowestBz",function(){return
this.cacheData.lowestPriceData.bz||false;});PriceInfo.method("lowestApp",function(){return
this.cacheData.lowestPriceData.tp=="a";});PriceInfo.method("lowestTerm",function(){return
this.cacheData.lowestPriceData.tp=="t";});PriceInfo.method("lowestnPrice",function(){return
this.cacheData.nlp;});PriceInfo.method("lowestaPrice",function(){return
this.cacheData.alp;});function PriceData(b){this.cacheData=b;var
a=null;this.rawData=function(c){if(c==null){return
a;}else{a=c;}};}PriceData.method("price",function(){return
parseInt(this.cacheData.pr);});PriceData.method("nprice",function(){return
parseInt(this.cacheData.npr);});PriceData.method("cprice",function(){return
parseInt(this.cacheData.cpr);});PriceData.method("cangwei",function(){return
this.cacheData.cw;});PriceData.method("tgq",function(){var
b=this.cacheData.tgq;if(b==null){return false;}var
a=b.split("|");if(a.length&gt;1){return a.join("&lt;br
/&gt;");}else{return b+'&lt;div
class="tip"&gt;閫€鏀圭瑙勫畾浠ヨ埅绌哄叕鍙告渶鏂版爣鍑嗕负鍑嗐€�&lt;/div&gt;';}});PriceData.method("tgqId",function(){return
this._cacheData.tgqId;});PriceData.method("bz",function(){if(this.cacheData.bz){return
this.cacheData.bz;}else{return
false;}});PriceData.method("isApp",function(){if(this.cacheData.tp=="a"){return
true;}else{return
false;}});PriceData.method("isTerm",function(){if(this.cacheData.tp=="t"){return
true;}else{return
false;}});PriceData.method("childPrice",function(){return
parseInt(this.cacheData.cpr);});PriceData.method("discount",function(){if(this.cangwei()=="C"){return"鍟嗗姟鑸�";}if(this.cangwei()=="F"){return"澶寸瓑鑸�";}if(this.cacheData.dt=="0.0"){return"鍏ㄤ环";}return
this.cacheData.dt.replace(".0","")+"鎶�";});PriceData.method("cwNum",function(){return
this.cacheData.tn;});PriceData.method("isalpr",function(){if(this.rawData().lowestaPrice()==this.price()){return
true;}else{return
false;}});PriceData.method("isnlpr",function(){if(this.rawData().lowestnPrice()==this.price()){return
true;}else{return false;}});function
OneWayFlight(a){OneWayFlight.superclass.constructor.call(this,a);this._showFilter=false;this._showThreeDay=false;}$jex.extendClass(OneWayFlight,DataCenter);OneWayFlight.method("showList",function(b,d){var
c=new OneWayFlightUI({elemId:"flightList"});var
a={keys:b,data:d};c.rawData(this);c.updateSource(a);c.render();if(!this._showFilter){this.showFilter();}if(!this._showSort){this.showSort();}if(!this._showThreeDay){this.showThreeDay();}this.showLineInfo();});OneWayFlight.method("showFilter",function(){var
a=new
FilterUI({elemId:"filterPanel"});a.ownerData(this);a.updateSource(this.getFilters());a.render();this._showFilter=true;});OneWayFlight.method("showSort",function(){var
a=this;$jex.removeClassName($jex.$("sortPanel"),"hide");$jex.event.bind($jex.$("orderbytime"),"click",function(b){var
c=a.getNowKeys();c=a.sortKeys(c,"dt");a.breakPage(c);a.showPage(1);});$jex.event.bind($jex.$("orderbyprice"),"click",function(b){var
c=a.getNowKeys();c=a.sortKeys(c,"od");a.breakPage(c);a.showPage(1);});$jex.$("orderbyprice").click();this._showSort=true;});OneWayFlight.method("showLineInfo",function(){var
a=new
FlightInfoUI({elemId:"faInfo"});a.updateSource(this);a.render();this._showLineInfo=true;});OneWayFlight.method("showThreeDay",function(){var
a=new
ThreeDayUI({elemId:"threeDay"});a.updateSource(this);a.render();$jex.removeClassName($jex.$("threeDay"),"hide");this._showThreeDay=true;});function
PageUI(a){PageUI.superclass.constructor.call(this,a);var
b=null;this.owner=function(c){if(c==null){return
b;}else{b=c;}};}$jex.extendClass(PageUI,XControl);PageUI.method("update",function(b){var
a=this;var d=b.pages;var
e=parseInt(b.nowpage);if(d==0||e==0){return;}this.append("&lt;div","page",'
class="pager"&gt;');if(e!=1){this.append("&lt;a","prevPage",'
href="#"&gt;涓婁竴椤�&lt;/a&gt;
');}if(e&gt;3&amp;&amp;d&gt;5){this.createPageList(1,e);if(e&gt;4){this.text("...");}}for(var
c=1;c&lt;=d;c++){if(d==1){return;}if((c&lt;e-2&amp;&amp;c&lt;d-4)||((c&gt;e+2)&amp;&amp;c&gt;5)){}else{this.createPageList(c,e);}}if(d&gt;5&amp;&amp;e&lt;d-2){if(e&lt;d-3){this.text("...");}this.createPageList(d,e);}if(e!=d){this.append("
&lt;a","nextPage",'
href="#"&gt;涓嬩竴椤�&lt;/a&gt;');}this.text("&lt;/div&gt;");this.onInit(function(){var
g=this.find("prevPage");var
f=this.find("nextPage");if(g){$jex.event.bind(g,"click",function(h){a.owner().showPage(e-1);$jex.stopEvent(h);});}if(f){$jex.event.bind(f,"click",function(h){a.owner().showPage(e+1);$jex.stopEvent(h);});}});});PageUI.method("createPageList",function(a,d){var
c={page:a,nowpage:d};var b=new
PageListUI();b.ownerListUI(this);b.dataSource(c);b.updateSource();this.append("",b,"");b.render();});function
PageListUI(){PageListUI.superclass.constructor.call(this);var
a=null;this.ownerListUI=function(b){if(b==null){return
a;}else{a=b;}};}$jex.extendClass(PageListUI,XControl);PageListUI.method("update",function(b){var
a=this;var c=b.page;var d=b.nowpage;if(d==c){this.text("
&lt;em&gt;");this.text(c,"&lt;/em&gt; ");}else{this.append("
&lt;a","pagelist",' href="#" onclick="return
false"&gt;');this.text(c,"&lt;/a&gt;
");}this.onInit(function(){$jex.event.binding(this.find("pagelist"),"click",function(e){a.ownerListUI().owner().showPage(this.innerHTML);});});});function
FilterUI(a){FilterUI.superclass.constructor.call(this,a);var
b=null;this.ownerData=function(c){if(c==null){return
b;}else{b=c;}};this._filters={};}$jex.extendClass(FilterUI,XControl);FilterUI.method("update",function(b){var
a=this;this.append("&lt;div","filter",'
class=""&gt;');$jex.hash.each(b,function(c,d){a.createList(d);});this.text("&lt;/div&gt;");this.onInit(function(){var
c=this.find("clearFilter");if(c){$jex.event.bind(c,"click",function(d){a.doFilter("airName",false);a.clearFilterActive();$jex.addClassName(this,"active");$jex.stopEvent(d);});}});});FilterUI.method("createList",function(b){var
a=this;if(b.data.length&gt;1){this.text('&lt;div
class="filterList"&gt;');this.text('&lt;span
style="float:left;"&gt;浠呮樉绀猴細&lt;/span&gt;');this.append("&lt;a","clearFilter",'
class="active" style="float:left;"
href="#"&gt;鍏ㄩ儴&lt;/a&gt;');this.text("&lt;span&gt;");$jex.array.each(b.data,function(c){var
d=new
FilterListUI();d.ownerListUI(a);d.dataSource({key:b.key,value:c});d.updateSource();a.append("",d,"");d.render();});this.text("&lt;/span&gt;");this.text("&lt;/div&gt;");}});FilterUI.method("clearFilterActive",function(){var
a=this.find("filter").getElementsByTagName("a");$jex.array.each(a,function(b){$jex.removeClassName(b,"active");});});FilterUI.method("doFilter",function(d,f){var
a=this;var
e=a.ownerData();if(f){if(!this._filters[d]){this._filters[d]=[f];}else{var
c=this._filters[d].indexOf(f);if(c&lt;0){this._filters[d]=[];this._filters[d].push(f);}}}else{this._filters[d]=[];}var
b=e.getKeys();$jex.hash.each(this._filters,function(h,g){var
i=e.doFilter(h,g);b=a.intersection(b,i);});b=this.undulpicate(b);if(typeof
e.getOderBy=="function"){b=e.sortKeys(b,e.getOderBy());}else{b=e.sortKeys(b,"od");}e.breakPage(b);e.showPage(1);});FilterUI.method("undulpicate",function(c){for(var
b=0;b&lt;c.length;b++){for(var
a=b+1;a&lt;c.length;a++){if(c[b]===c[a]){c.splice(a,1);a--;}}}return
c;});FilterUI.method("intersection",function(c,b){var
a=[];if(b.length&lt;1){return
c;}$jex.array.each(c,function(d){if(b.indexOf(d)&gt;-1){a.push(d);}});return
a;});function
FilterListUI(){FilterListUI.superclass.constructor.call(this);this.ownerListUI=function(a){if(a==null){return
this._ownerListUI;}else{this._ownerListUI=a;}};}$jex.extendClass(FilterListUI,XControl);FilterListUI.method("update",function(b){var
a=this;this.text("&lt;span&gt;");this.append("&lt;input","filterList",'
class="filterInput" type="radio"');this.text(' value="',b.value,'"
name="',b.key,'" /&gt;');this.tpls('&lt;label
for="{#filterList}"&gt;');this.tpls('&lt;a
id="flink{#filterList}"');this.text(' value="',b.value,'"
name="',b.key,'"href="#nogo"&gt;&lt;img align="absmiddle"
src="http://source.qunar.com/site/images/airlines/small/');this.text(b.value,'.gif"
/&gt;',this.ownerListUI().ownerData().getAirNameShort(b.value),"&lt;/a&gt;&lt;/label&gt;");this.text("&lt;/span&gt;");this.onInit(function(){var
c=this.find("flinkfilterList");if(c){$jex.event.bind(c,"click",function(){var
d=c.getAttribute("name");var e=c.getAttribute("value");var
f=a.ownerListUI();setTimeout(function(){f.doFilter(d,e);},200);f.clearFilterActive();$jex.addClassName(c,"active");});}});});function
OneWayFlightUI(a){OneWayFlightUI.superclass.constructor.call(this,a);var
b=null;this.rawData=function(c){if(c==null){return
b;}else{b=c;}};}$jex.extendClass(OneWayFlightUI,XControl);OneWayFlightUI.method("update",function(c){var
b=this;this.createTitle();this.text('&lt;div
class="flightPanel"&gt;');var a=0;$jex.array.each(c.keys,function(g){var
f=b.rawData().getExtInfo(g);f.rawData(b.rawData());var
h=b.rawData().priceInfo(g);h.rawData(b.rawData());var
d={finfo:f,pinfo:h,key:g,index:a};var e=new
OneWayFlightListUI();e.ownerData(d);e.updateSource(d);b.append("",e,"");e.render();a++;});this.text("&lt;/div&gt;");this.onInit(function(){var
e=this;var f=this.find("af");var
d=this.find("aftips");if(f){$jex.event.bind(f,"mouseover",function(){$jex.removeClassName(d,"hide");});$jex.event.bind(f,"mouseout",function(){$jex.addClassName(d,"hide");});}});});OneWayFlightUI.method("createTitle",function(){this.text('&lt;div
class="hd"&gt;');this.text(' &lt;div
class="c1"&gt;&amp;nbsp;&lt;/div&gt;');this.text(' &lt;div
class="c2"&gt;&lt;strong&gt;鑸┖鍏徃&lt;br /&gt;');this.text("
鑸彮鍙�&lt;/strong&gt;&lt;/div&gt;");this.text(' &lt;div
class="c3"&gt;&lt;strong&gt;璧烽檷鏃堕棿&lt;/strong&gt;&lt;/div&gt;');this.text('
&lt;div
class="c4"&gt;&lt;strong&gt;璧烽檷鏈哄満&lt;/strong&gt;&lt;/div&gt;');this.text('
&lt;div class="c5"&gt;&lt;strong&gt;浠锋牸 /
鑸变綅&lt;/strong&gt;&lt;/div&gt;');this.text(' &lt;div
class="c6"&gt;&lt;strong&gt;閫€鏀圭&lt;/strong&gt;&lt;/div&gt;');this.text('
&lt;div class="c7"&gt;');this.append(" &lt;div","af",' class="pop
pop_ofee"&gt;&lt;strong&gt;鏈哄缓/鐕冩补&lt;/strong&gt;');this.append("&lt;div","aftips",'
class="box hide aftips"&gt;&lt;b class="arr"&gt;&lt;/b&gt;');this.text('
&lt;div class="inner"&gt;鏈哄満寤鸿璐� / 鐕冩补闄勫姞绋�&lt;/div&gt;');this.text("
&lt;/div&gt;");this.text(" &lt;/div&gt;");this.text("
&lt;/div&gt;");this.text(' &lt;div
class="c8"&gt;&lt;strong&gt;澶囨敞&lt;/strong&gt;&lt;/div&gt;');this.text("&lt;/div&gt;");});function
OneWayFlightListUI(){OneWayFlightListUI.superclass.constructor.call(this);var
a=null;this.ownerData=function(b){if(b==null){return
a;}else{a=b;}};}$jex.extendClass(OneWayFlightListUI,XControl);OneWayFlightListUI.method("update",function(e){var
a=this;var c=e.finfo;var f=e.pinfo;var h=this.ownerData();var g=new
PriceData(f.lowestPriceData());this.append("&lt;div","flightList",'
class="ct"
style="z-index:');this.text((300-e.index)*2,'"&gt;');this.text(' &lt;div
class="c1"&gt;&lt;img
src="http://source.qunar.com/site/images/airlines/small/',c.airCode(),'.gif"
/&gt;&lt;/div&gt;');this.text(' &lt;div
class="c2"&gt;',c.getAirName(),"&lt;br /&gt;");this.text("
&lt;strong&gt;",f.lineCode(),'&lt;/strong&gt; &lt;!--&lt;span
class="planType"&gt;',c.flightType(),"&lt;/span&gt;--&gt;&lt;/div&gt;");this.text('
&lt;div class="c3"&gt;&lt;strong
class="time1"&gt;',c.deptTime(),"&lt;/strong&gt;&lt;br
/&gt;");this.text(' &lt;strong
class="time2"&gt;',c.arriTime(),"&lt;/strong&gt;&lt;/div&gt;");this.text('
&lt;div class="c4"&gt;',c.deptAirport(),"&lt;br /&gt;");this.text("
",c.arriAirport(),"&lt;/div&gt;");this.text(' &lt;div
class="c5"&gt;');this.text(' &lt;div
class="pr"&gt;&amp;yen;&lt;strong&gt;',f.lowestPrice(),"&lt;/strong&gt;&lt;/div&gt;");if(this.needCwTips(f.lowestCw())){this.append("&lt;div","cw",'
class="pop
pop_cp"&gt;/');this.text(f.lowestCw(),"鑸�");this.append("&lt;div","cwtips",'
class="box
hide"&gt;');this.text(this.cwTips(f.lowestCw()));}else{this.text('
&lt;div class="pop_cp"&gt;/',f.lowestCw(),"鑸�");}this.text("
&lt;/div&gt;");this.text(" &lt;/div&gt;");this.text(' &lt;div
class="c6"&gt;');if(f.lowestTgq()){this.append("&lt;div","tgq",'
class="pop pop_is"&gt;閫€鏀圭');this.append("&lt;div","tgqtip",'
class="box hide"&gt;&lt;b class="arr"&gt;&lt;/b&gt;');this.text('
&lt;div class="inner"&gt;',f.lowestTgq());this.text("
&lt;/div&gt;");this.text(" &lt;/div&gt;");this.text("
&lt;/div&gt;");}else{this.text('&lt;div
class="gray"&gt;鏆傛棤淇℃伅&lt;/div&gt;');}this.text("
&lt;/div&gt;");this.text(' &lt;div
class="c7"&gt;&amp;yen;',f.airportPrice(),"/&amp;yen;",f.fuelPrice(),"&lt;/div&gt;");this.text('
&lt;div class="c8"&gt;');if(c.shareCode()){this.text('&lt;span
style="color:#f00;"&gt;浠ｇ爜&lt;br
/&gt;鍏变韩&lt;/span&gt;');}if(f.lowestBz()){this.text(f.lowestBz());}this.text("&lt;/div&gt;");this.text('
&lt;div class="bb"&gt;');this.append(" &lt;button","booking",'
class="btn"&gt;');if(f.lowestApp()){this.text("鐢宠");}else{if(f.lowestTerm()){this.text("鍥㈤槦浜у搧");}else{this.text("棰勮");}}this.text("&lt;/button&gt;");if(f.priceData().length&gt;1){this.tpls('&lt;a
href="#" class="col"
id="show{#flightList}"&gt;灞曞紑鑸变綅&lt;/a&gt;');}this.text("
&lt;/div&gt;");this.text("&lt;/div&gt;");if(f.priceData().length&gt;0){this.append("&lt;div","morePrice",'
class="et hide"');this.text('
style="z-index:',(300-e.index)*2-1,'"&gt;');var d=c.rawData();var
b=0;$jex.array.each(f.priceData(),function(i){if(b&gt;0){var k=new
PriceListUI();k.ownerData(e);k.ownerList(a);var j=new
PriceData(i);j.rawData(f);j.index=b;k.updateSource(j);a.append("",k,"");k.render();}b++;});a.insertFooter(e);this.text("&lt;/div&gt;");}else{this.text("&lt;p&gt;娌℃湁鍙璁㈢殑鑸变綅&lt;/p&gt;");}this.onInit(function(){var
k=this.find("showflightList");var n=this.find("priceListflightList");var
m=this.find("booking");$jex.event.bind(m,"click",function(){a.createrBooking(g);});var
l=false;var
o=this.find("morePrice");if(k){$jex.event.bind(k,"click",function(p){if(l==false){$jex.removeClassName(o,"hide");this.innerHTML="鏀惰捣鑸变綅";this.className="exp";l=true;}else{$jex.addClassName(o,"hide");this.innerHTML="灞曞紑鑸变綅";this.className="col";l=false;}$jex.stopEvent(p);});}var
i=this.find("cw");if(i){$jex.event.bind(i,"mouseover",function(q){var
p=a.find("cwtips");$jex.removeClassName(p,"hide");});$jex.event.bind(i,"mouseout",function(q){var
p=a.find("cwtips");$jex.addClassName(p,"hide");});}var
j=this.find("tgq");if(j){$jex.event.bind(j,"mouseover",function(p){var
q=a.find("tgqtip");$jex.removeClassName(q,"hide");});$jex.event.bind(j,"mouseout",function(p){var
q=a.find("tgqtip");$jex.addClassName(q,"hide");});}});});OneWayFlightListUI.method("parseFood",function(a){if(a){return"鏈�";}else{return"鏃&nbsp;";}});OneWayFlightListUI.method("insertFooter",function(b){var
a=b.finfo;var c=b.pinfo;var
d=this.ownerData().finfo.rawData();this.text('&lt;div
class="intro"&gt;');this.text(' &lt;div
class="d"&gt;閲岀▼锛�',d.getDistance(),"鍏噷 | 鍘嗘椂锛�",a.allTime()," |
缁忓仠锛�",a.stopInfo(),"&lt;/div&gt;");this.text("&lt;/div&gt;");});OneWayFlightListUI.method("createrBooking",function(g){var
h=this.ownerData().finfo.rawData();var b=this.ownerData().finfo;var
e=this.ownerData().pinfo;var a=this.ownerData().key;var
c=1;if(h.isRoundtrip()){c=2;}var
f=["booking.htm?from=",b.deptAirportCode(),"&amp;to=",b.arriAirportCode(),"&amp;fln=",a,"&amp;cw=",g.cangwei(),"&amp;price=",g.price(),"&amp;nprice=",g.nprice(),"&amp;deptTime=",b.deptTime().replace(":",""),"&amp;flight_type=",c];if(b.shareCode()){f.push("&amp;gx=",b.shareCode());}else{f.push("&amp;gx=");}if(h.isRoundtrip()&amp;&amp;h.isReturn()){var
d=h.getToData();f.push("&amp;tfrom=",d.deptAirportCode,"&amp;tto=",d.arriAirportCode,"&amp;tcw=",d.cangwei,"&amp;tprice=",d.price,"&amp;tnprice=",d.nprice,"&amp;tfln=",d.airCode,"&amp;starttime=",h.arriDate(),"&amp;returntime=",h.deptDate());}else{f.push("&amp;starttime=",h.deptDate(),"&amp;returntime=",h.arriDate());}window.location.href=f.join("");});OneWayFlightListUI.method("cwTips",function(a){var
b=[];if(a=="C"||a=="F"){b.push(' &lt;b
class="arr"&gt;&lt;/b&gt;');b.push(' &lt;div
class="inner"&gt;',a,"鑸憋細");if(a=="C"){b.push("鍟嗗姟鑸�");}else{if(a=="F"){b.push("澶寸瓑鑸�");}}b.push("
&lt;/div&gt;");b.push(" &lt;/div&gt;");}return
b.join("");});OneWayFlightListUI.method("needCwTips",function(a){if(a=="C"||a=="F"){return
true;}else{return false;}});function
PriceListUI(){PriceListUI.superclass.constructor.call(this);var
b=null;this.ownerData=function(c){if(c==null){return b;}else{b=c;}};var
a=null;this.ownerList=function(c){if(c==null){return
a;}else{a=c;}};}$jex.extendClass(PriceListUI,XControl);PriceListUI.method("update",function(b){var
a=this;if(!(this.ownerData().finfo.rawData().isRoundtrip()&amp;&amp;b.isApp())){this.text('&lt;div
class="ect" style="z-index:',100-b.index,'"&gt;');this.text(' &lt;div
class="c1"&gt;&amp;nbsp;&lt;/div&gt;');this.text(' &lt;div
class="c2"&gt;&amp;nbsp;&lt;/div&gt;');this.text(' &lt;div
class="c3"&gt;&amp;nbsp;&lt;/div&gt;');this.text(' &lt;div
class="c4"&gt;&amp;nbsp;&lt;/div&gt;');this.text(' &lt;div
class="c5"&gt;');this.text(' &lt;div
class="pr"&gt;&amp;yen;&lt;strong&gt;',b.price(),"&lt;/strong&gt;&lt;/div&gt;");if(this.ownerList().needCwTips(b.cangwei())){this.append("&lt;div","cw",'
class="pop
pop_cp"&gt;/');this.text(b.cangwei(),"鑸�");this.append("&lt;div","cwtips",'
class="box
hide"&gt;');this.text(this.ownerList().cwTips(b.cangwei()));}else{this.text('
&lt;div class="pop_cp"&gt;/',b.cangwei(),"鑸�");}this.text("
&lt;/div&gt;");this.text(" &lt;/div&gt;");this.text(' &lt;div
class="c6"&gt;');if(b.tgq()){this.append(" &lt;div","tgq",' class="pop
pop_is"&gt;閫€鏀圭');this.append("&lt;div","tgqtip",' class="box
hide"&gt;&lt;b class="arr"&gt;&lt;/b&gt;');this.text(' &lt;div
class="inner"&gt;',b.tgq());this.text(" &lt;/div&gt;");this.text("
&lt;/div&gt;");this.text("&lt;/div&gt;");}else{this.text(' &lt;div
class="gray"&gt;鏆傛棤淇℃伅&lt;/div&gt;');}this.text("
&lt;/div&gt;");this.text(' &lt;div
class="c7"&gt;&amp;yen;',this.ownerData().pinfo.airportPrice(),"/&amp;yen;",this.ownerData().pinfo.fuelPrice(),"&lt;/div&gt;");this.text('
&lt;div
class="c8"&gt;');if(this.ownerData().finfo.shareCode()){this.text('&lt;span
style="color:#f00;"&gt;浠ｇ爜&lt;br
/&gt;鍏变韩&lt;/span&gt;');}if(b.bz()){this.text(b.bz());}this.text("&lt;/div&gt;");this.text('
&lt;div class="bb"&gt;');this.append(" &lt;button","bookingBtn",'
class="btn"&gt;');if(b.isApp()){this.text("鐢宠");}else{if(b.isTerm()){this.text("鍥㈤槦浜у搧");}else{this.text("棰勮");}}this.text("
&lt;/button&gt;");this.text("
&lt;/div&gt;");this.text("&lt;/div&gt;");this.onInit(function(){var
d=this.find("bookingBtn");var j=this.ownerData().finfo.rawData();var
h=this.ownerData().finfo;var i=this.ownerData().pinfo;var
g=this.ownerData().key;var
c=this.find("cw");if(c){$jex.event.bind(c,"mouseover",function(l){var
k=a.find("cwtips");$jex.removeClassName(k,"hide");});$jex.event.bind(c,"mouseout",function(l){var
k=a.find("cwtips");$jex.addClassName(k,"hide");});}var
f=this.find("tgq");if(f){$jex.event.bind(f,"mouseover",function(k){var
l=a.find("tgqtip");$jex.removeClassName(l,"hide");});$jex.event.bind(f,"mouseout",function(k){var
l=a.find("tgqtip");$jex.addClassName(l,"hide");});}if(j.isRoundtrip()&amp;&amp;!j.isReturn()){$jex.event.bind(d,"click",function(k){var
l=e();j.setAtt("gotoData",l);j.setAtt("_showFilter",false);j.setAtt("_showSort",false);j.setAtt("isRet",true);j.setAtt("gt",h.arriTime());j.doSearchReturn();$jex.stopEvent(k);});}else{$jex.event.bind(d,"click",function(k){a.ownerList().createrBooking(b);});}function
e(){return{deptAirport:h.deptAirport(),deptAirportCode:h.deptAirportCode(),deptTime:h.deptTime(),arriAirport:h.arriAirport(),arriAirportCode:h.arriAirportCode(),arriTime:h.arriTime(),airName:h.getAirName(),stopInfo:h.stopInfo(),cangwei:b.cangwei(),airCode:g,disCount:b.discount(),price:b.price(),nprice:b.nprice(),cprice:b.cprice(),cnprice:b.cprice(),ry:i.fuelPrice(),cry:i.fuelcPrice()};}});}});function
FlightInfoUI(a){FlightInfoUI.superclass.constructor.call(this,a);var
b=null;this.ownerData=function(c){if(c==null){return
b;}else{b=c;}};}$jex.extendClass(FlightInfoUI,XControl);FlightInfoUI.method("update",function(b){var
a=b;if(!a.isRoundtrip()){this.text('&lt;div
class="info"&gt;',a.deptDate()," ",a.deptDateWeek(),"
鍏�",a.getNums(),"涓埅鐝�&lt;/div&gt;");this.text('&lt;div
class="line"&gt;',a.deptCity(),"鈫�",a.arriCity(),"&lt;/div&gt;");}else{if(!a.isReturn()){if(a.noData){this.text('鎮ㄦ煡璇㈢殑鏄�&lt;span
class="city"&gt;',a.deptCity(),'&lt;/span&gt;鍒�&lt;span
class="city"&gt;',a.arriCity(),'&lt;/span&gt;&lt;span
class="date"&gt;',a.deptDate(),'&lt;/span&gt;鍑哄彂&lt;span
class="date"&gt;',a.arriDate(),"&lt;/span&gt;杩斿洖鐨勫線杩旇埅鐝紝鏈煡璇㈠埌鐩稿叧鑸彮銆�");}else{this.text('鎮ㄦ煡璇㈢殑鏄�&lt;span
class="city"&gt;',a.deptCity(),'&lt;/span&gt;鍒�&lt;span
class="city"&gt;',a.arriCity(),'&lt;/span&gt;&lt;span
class="date"&gt;',a.deptDate(),'&lt;/span&gt;鍑哄彂&lt;span
class="date"&gt;',a.arriDate(),"&lt;/span&gt;杩斿洖鐨勫線杩旇埅鐝紝璇峰厛閫夋嫨&lt;strong&gt;鍘荤▼&lt;/strong&gt;鑸彮鍜岃埍浣嶃€�");}}else{if(a.noData){this.text('鎮ㄦ煡璇㈢殑鏄�&lt;span
class="city"&gt;',a.deptCity(),'&lt;/span&gt;鍒�&lt;span
class="city"&gt;',a.arriCity(),'&lt;/span&gt;&lt;span
class="date"&gt;',a.deptDate(),'&lt;/span&gt;鍑哄彂&lt;span
class="date"&gt;',a.arriDate(),"&lt;/span&gt;杩斿洖鐨勫線杩旇埅鐝紝鏈煡璇㈠埌鐩稿叧鑸彮銆�");}else{this.text('鎮ㄦ煡璇㈢殑鏄�&lt;span
class="city"&gt;',a.deptCity(),'&lt;/span&gt;鍒�&lt;span
class="city"&gt;',a.arriCity(),'&lt;/span&gt;&lt;span
class="date"&gt;',a.deptDate(),'&lt;/span&gt;鍑哄彂&lt;span
class="date"&gt;',a.arriDate(),"&lt;/span&gt;杩斿洖鐨勫線杩旇埅鐝紝璇烽€夋嫨&lt;strong&gt;鍥炵▼&lt;/strong&gt;鑸彮鍜岃埍浣嶃€�");}}}this.onInit(function(){$jex.removeClassName($jex.$("flightAirInfo"),"hide");});});FlightInfoUI.method("dayToWeek",function(a){});function
ThreeDayUI(a){ThreeDayUI.superclass.constructor.call(this,a);}$jex.extendClass(ThreeDayUI,XControl);ThreeDayUI.method("update",function(c){var
f=c;var g=QunarDate.parse(f.deptDate());var b=window.location.href;var
d=b.replace(f.deptDate(),QunarDate.format(new
Date(g.getTime()-24*60*60*1000)));var
a=b.replace(f.deptDate(),QunarDate.format(new
Date(g.getTime()+24*60*60*1000)));if(g.getTime()&gt;QunarDate.today().getTime()){this.text('&lt;a
href="',d,'"&gt;&amp;lt;-鍓嶄竴澶�&lt;/a&gt;');}this.text(' &lt;a
href="',a,'"&gt;鍚庝竴澶�-&amp;gt;&lt;/a&gt;');});(function(){initSearchBox({fromHotCity:CityConfig.china["top20"],toHotCity:CityConfig.china["top20"]});var
a=window.oneWayFlight=new
OneWayFlight({dataInterface:location.href.indexOf("tts.qunar")&gt;-1?"http://ttsdev1.qunar.com/tts/interface/search.jsp?":"/tts/interface/search.jsp?",fromCity:FlightForm.fromCity.getValue(),toCity:FlightForm.toCity.getValue(),fromDate:FlightForm.fromDate.getValue(),returnDate:FlightForm.returnDate.getValue(),flyType:FlightForm.flyType});a.getData();})();
